package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.EmployeeDto;
import com.sky.dto.EmployeeLoginDto;
import com.sky.dto.EmployeeModifyPasswordDto;
import com.sky.dto.EmployeePageQueryDto;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import com.sky.result.PageResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EmployeeMapper {
    Employee selectByUserName(@Param("employeeLoginDto") EmployeeLoginDto employeeLoginDto);

    @AutoFill(OperationType.INSERT)
    void insert(Employee employee);

    Page<Employee> queryPage(EmployeePageQueryDto employeePageQueryDto);
    void upDateByStatus(Integer status, Long id);

    int comparePassword(Long empId, String oldPassword);
    void modifyPassword(EmployeeModifyPasswordDto employeeModifyPasswordDto);

    Employee getById(Long id);
    @AutoFill(OperationType.UPDATE)
    void modifyEmployee( Employee employee);

    //旧版分页查询使用的查询表中有多少元素的
   /* long count(String name);*/

    //旧版分页查询查询表中符合所有规定的元素
    /*List<Employee> findByList(@Param("pageBean") Integer pageBean,
                              @Param("pageSize") Integer pageSize,
                              @Param("name") String name);*/
}
